package cn.mafangui.hotel.mapper;

import cn.mafangui.hotel.entity.echarsEntity.Pie;
import cn.mafangui.hotel.req.OrderQueryReq;
import cn.mafangui.hotel.entity.Order;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface OrderMapper {

    int deleteByPrimaryKey(Integer orderId);

    int insert(Order record);

    int insertSelective(Order record);

    Order selectByPrimaryKey(Integer orderId);

    Order selectByNameAndPhone(Order record);

    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);

    Integer getOrderCount();

    List<Order> selectAll();

    List<Order> selectByUserId(Integer userId);

    List<Order> selectAllByUser(@Param("userId") Integer userId,@Param("orderStatus") Integer orderStatus);

    /**
     * 根据[订单号、用户名、用户姓名、用户身份证号,手机号]查找订单
     * @param req
     * @return
     */
    List<Order> query(OrderQueryReq req);
    /**
     * 统计 所有订单 其所属的房间类型
     */
    List<Pie> findAllOrderAndRoomType();

    /**
     * 统计 每个月的订单量
     * @return
     */
    List<Pie> statisticalOrderNumByMonth();
}
